import requests

# 添加员工
resp = requests.post(url="http://ihrm-test.itheima.net/api/sys/user",
                     headers={"Authorization": "ca0da927-ae56-4902-b8ce-78ab8c8b55ad"},
                     json={
                         "username": "user87655430",
                         "mobile": "13947884780",
                         "workNumber": "9527890aa"
                     })
print("添加员工：", resp.json())
# 查询员工
resp = requests.get(url="http://ihrm-test.itheima.net/api/sys/user/1494919461403222016",
                    headers={"Authorization": "ca0da927-ae56-4902-b8ce-78ab8c8b55ad"})
print("查询员工：", resp.json())

# 修改员工
resp = requests.put(url="http://ihrm-test.itheima.net/api/sys/user/1494919461403222016",
                    headers={"Authorization": "ca0da927-ae56-4902-b8ce-78ab8c8b55ad"},
                    json={"username": "至宗宝99"})
print("修改员工：", resp.json())

# 删除员工
resp = requests.delete(url="http://ihrm-test.itheima.net/api/sys/user/1494919461403222016",
                       headers={"Authorization": "ca0da927-ae56-4902-b8ce-78ab8c8b55ad"})
print("删除员工：", resp.json())